<?php

defined('SYSPATH') or die('Access error!');


//问答平台的用户中心管理--回复
Route::set('user/q2a', 'user/q2a(/<controller>(/<action>(/<id>)))', array('id' => '\d+',
            'action' => 'list|all|unanswer|answered'))
        ->defaults(array(
            'directory' => 'user/q2a',
            'controller' => 'question',
            'action' => 'all',
        ));

//供求平台
Route::set('user/trade', 'user/trade(/<controller>(/<action>(/<id>)))')
        ->defaults(array(
            'directory' => 'user/trade',
            'controller' => 'post',
        ));

//用户登录注册
Route::set('user', 'user(/<action>(/<id>))', array('id' => '\d+',
            'action' => 'register|login|logout'))
        ->defaults(array(
            'controller' => 'user',
            'action' => 'register',
        ));


//用户中心路由器
Route::set('user_center', 'user(/<controller>(/<action>(/<id>)))')
        ->defaults(array(
            'directory' => 'user',
            'controller' => 'base',
            'action' => 'index',
        ));

//商城相关
Route::set('shop', 'user/shop(/<action>(/<id>))', array('id' => '\d+',
            'action' => 'add'))
        ->defaults(array(
            'controller' => 'shop',
            'action' => 'add',
        ));



Route::set('admin/user', 'admin/user(/<action>(/<id>(/<status>)))', array('id' => '\d+',
            'action' => 'list|set_admin|edit|left|search|delete|admin|status'))
        ->defaults(array(
            'directory' => 'admin',
            'controller' => 'user',
            'action' => 'add',
        ));

//用户的公共操作
Route::set('user/ajax', 'user/ajax(/<action>(/<id>(/<status>)))', array('id' => '\d+',
            'action' => 'delete_collect'))
        ->defaults(array(
            'directory' => 'user',
            'controller' => 'ajax',
        ));

//用户组
Route::set('admin/usergroup', 'admin/usergroup(/<action>(/<id>))(/p<page>)', array('id' => '\d+', 'page' => '\d+',
            'action' => 'list|add|edit|delete|transfer|batch_position|set_default'))
        ->defaults(array(
            'directory' => 'admin',
            'controller' => 'usergroup',
            'action' => 'list',
        ));
//权限管理
Route::set('admin/privilege', 'admin/privilege(/<action>(/<id>))(/p<page>)', array('id' => '\d+', 'page' => '\d+',
            'action' => 'list|add|edit|delete|transfer|createfile'))
        ->defaults(array(
            'directory' => 'admin',
            'controller' => 'privilege',
            'action' => 'add',
        ));

